import { path } from "../../config/path";
import request from './request';

/** 角色列表 GET /manage/get_role_list */
export async function role_list(body: any, options?: any) {
  return request(path + '/manage/get_role_list', {
    method: 'GET',
    headers: {
      Authorization: localStorage.loginToken,
    },
    params: body,
    ...(options || {}),
  });
}
/** 新增或编辑角色 POST /manage/add_edit_role */
export async function add_edit_role(body?: any, options?: any) {
  return request(path + '/manage/add_edit_role', {
    method: 'POST',
    headers: {
      Authorization: localStorage.loginToken,
    },
    data: body,
    ...(options || {}),
  });
}
/** 角色详情 GET /manage/get_role_info */
export async function role_info(body: any, options?: any) {
  return request(path + '/manage/get_role_info', {
    method: 'GET',
    headers: {
      Authorization: localStorage.loginToken,
    },
    params: body,
    ...(options || {}),
  });
}
/** 设置角色权限 POST /manage/set_role_auth */
export async function role_auth(body: any, options?: any) {
  return request(path + '/manage/set_role_auth', {
    method: 'POST',
    headers: {
      Authorization: localStorage.loginToken,
    },
    data: body,
    ...(options || {}),
  });
}
/** 修改角色状态 POST /manage/edit_role_status */
export async function role_status(body: any, options?: any) {
  return request(path + '/manage/edit_role_status', {
    method: 'POST',
    headers: {
      Authorization: localStorage.loginToken,
    },
    data: body,
    ...(options || {}),
  });
}
/** 删除角色 POST /manage/delete_role */
export async function delete_role(body: any, options?: any) {
  return request(path + '/manage/delete_role', {
    method: 'POST',
    headers: {
      Authorization: localStorage.loginToken,
    },
    data: body,
    ...(options || {}),
  });
}
/** 角色列表(下拉框) GET /manage/get_role_select */
export async function role_select(body?: any, options?: any) {
  return request(path + '/manage/get_role_select', {
    method: 'GET',
    headers: {
      Authorization: localStorage.loginToken,
    },
    params: body,
    ...(options || {}),
  });
}
